/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package probando;



/**
 *
 * @author VWV
 */
public class RunNoJoin implements Runnable{
    private UiPrincipal view = null;
    private boolean consola = false;

    public RunNoJoin(UiPrincipal view, boolean consola){

        if (view!=null) {
            this.view = view;
            this.consola = consola;
        } else {
            System.exit(1);
        }

    }
    
    public void run() {
        if (consola)
           System.out.println("\n----\n");

        view.limpiarOutput();

        Thread moe = new Thread(new Contador(view,"Moe",consola));
        Thread larry = new Thread(new Contador(view,"Larry",consola));
        Thread curly = new Thread(new Contador(view,"Curly",consola));

        moe.start();
        larry.start();
        curly.start();
        
        try {
            curly.join();
        } catch (InterruptedException ex) {
            System.out.println("Interrumpido el join del runner");
        }
                    
        view.restablecerVentana();
    }

}
